package org.crazyit.test.controller;

import org.crazyit.test.util.JSONResult;
import org.crazyit.test.util.TokenAuthenticationUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class AuthController {
	
	@RequestMapping(value="auth", method=RequestMethod.GET)
	public String login(String username, String password) {
		System.err.println("===================auth=====================");
		String token = TokenAuthenticationUtil.addAuthentication(username);
		return 	JSONResult.fillResultString(0, "", token);
	}

}
